#ifndef __BUTTON_H__
#define __BUTTON_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "stdint.h"

#define MOTOR_START_UP_KEY_CODE      	(0x01)

// PA15--KEY		
#define KEY_PIN							GPIO_PIN_5
#define KEY_PORT						GPIOA	
#define KEY_CLK_ENABLE() 				__HAL_RCC_GPIOA_CLK_ENABLE()
	
#define KEY_PRESS_FLAG					(0) 			
#define KEY_RELEASE_FLAG				(1) 
	
#define KEY_SHORT_PRESS_TIME            (50)   
#define KEY_LONG_PRESS_TIME             (5000)   

typedef enum{
    KEY_EVEN_NULL = 0,
    KEY_EVEN_PRESS,
    KEY_EVEN_LONG_PRESS,
}KeyCmd_e;	
typedef struct
{
	uint8_t 	PressTimeCount;														
    KeyCmd_e 	KeyCmd;															
}UserKey_t;

extern UserKey_t UserKey;

extern void KeyInit(void);
extern void KeyTask(void);

#ifdef __cplusplus
}
#endif

#endif
